package com.cwf.quality.common.enums;

public enum ResponseEnum {

    SUCEESS(0, "请求成功"),
    FAIL(-1, "请求失败"),

    ;

    private int code;
    private String message;

    ResponseEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ResponseEnum codeOf(int code) {
        for (ResponseEnum responseEnum : values()) {
            if (responseEnum.code == code) {
                return responseEnum;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
